#ifndef MAIN_H
#define MAIN_H
#include "utils/logger.h"
#include "units/player.h"
#include "units/game.h"
#include "database/dataserver.h"
#include "utils/Config.h"
#include "server/logonserver.h"
#include "handlers/sessionhandler.h"
#include "utils/configfile.h"
#include <QMap>
#include <QList>


extern QMap<int,QString> TL2CMD_NAMES;
extern QMap<int, Player*> LPlayers;
extern QMap<quint64, Game*> LGames;
extern Logg::Logger* _log;
extern DataServer* database;
extern LogonServer* LoginServer;
extern QMap<QTcpSocket*,Handlers::SessionHandler*> Clients;
extern Config* CfgFile;
extern quint32 wanIPint;
extern quint32 lanIPint;
void init();
void ReadConfig();
QString getTestPacket();
bool FILTER_TCP(quint16 cmd);
bool FILTER_UDP(quint16 cmd);

quint32 GetCorrectIP(quint32 dst);
quint32 GetCorrectIP(quint32 src,quint32 dst);
quint32 GetCorrectIP(QTcpSocket src,QTcpSocket dst);

void setup_network();

#endif // MAIN_H
